import os
from environs import Env
from mytypes import Bots, Settings


def _get_settings():
    env = Env()

    __location__ = os.path.realpath(
        os.path.join(os.getcwd(), os.path.dirname(__file__))
    )

    env.read_env(os.path.join(__location__, ".env"))
    return Settings(
        bots=Bots(
            tg_token=env.str("TG_TOKEN"), 
            admin_id=env.int("ADMIN_ID"),
            notification_channel_id=env.int("NOTIFICATION_CHANNEL_ID"),
        ),
        is_prod=env.bool("IS_PROD")        
    )


settings = _get_settings()
